<template>
	<wt-model-info 
	class="patient-info-message"
	v-on:input="handleLoad" 
	:auto-load="autoLoad"  
	:ref="userInfo.name" 
	:model="userInfo" 
	:params-data="paramsData" 
	:value="patient_info"
	:allow-edit="hasEditPermission" 
	></wt-model-info>
</template>
<script>
	import Vue from "vue"
	import userInfo_model from '../model/patient-Info'
	import info from 'winged/components/wt-model-info'
	import WtPatientClass from '../components/wt-patient-class'
	import askToConfirm from '../components/ask-to-confirm'
	Vue.component(WtPatientClass.name, WtPatientClass)
	Vue.component(askToConfirm.name, askToConfirm)
	export default {
		name:'patient-info-message',
		components:{
			[[info.name]]:info,
			[[askToConfirm.name]]:askToConfirm
		},
		props:{
			paramsData:{
				type: Object,
				default: function(){
					return {};
				}
			},
			autoLoad:{
				type: Boolean,
				default: true
			},
			patientInfo:{
				type: Object,
				default: function() {
                    return null
                }
			}
		},
		data(){
			return{
				userInfo:userInfo_model,
				params: this.paramsData,
				hasEditPermission: false,
				patient_info: this.patientInfo
			}

		},
		watch:{
			'patientInfo':function(val){
				this.patient_info = Object.assign({},val);
			}
		},
		methods:{			
			handleLoad(data){
				this.$emit('src', data);	
			}
		},
		created(){
			// console.log(this.patientInfo);
			// console.log(this.paramsData)
		}
	}

</script>
<style lang="less">
.patient-info-message{
	.wt-form-label{
		padding:0 20px!important;
	}
}
	
</style>